<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('定时任务列表')"/>
    <th:block th:include="include :: layout-latest-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                任务：<select name="taskId" th:with="tasks=${@scheduleService.selectScheduleDicts()}" required>
                                <option value="">所有</option>
                                <option th:each="task : ${tasks}" th:text="${task.taskName}"
                                        th:value="${task.taskId}"></option>
                            </select>
                            </li>
                            <li class="select-time">
                                <label>日志时间： </label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                       name="startTime" required/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" required/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <!--		        <div class="btn-group-sm" id="toolbar" role="group">-->
            <!--		             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" >-->
            <!--			            <i class="fa fa-edit"></i> 修改-->
            <!--			        </a>-->
            <!--		        </div>-->

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<script th:inline="javascript">
    var prefix = ctx + "pub/schedule";

    $(function () {

        queryScheduleList();
    });

    function queryScheduleList() {
        var options = {
            url: prefix + "/list",
            // createUrl: prefix + "/add",
            // updateUrl: prefix + "/edit/{id}",
            // removeUrl: prefix + "/remove",
            // exportUrl: prefix + "/export",
            // importUrl: prefix + "/importData",
            // importTemplateUrl: prefix + "/importTemplate",
            // sortName: "createTime",
            // sortOrder: "desc",
            firstLoad: false,
            modalName: "定时任务列表",
            clickToSelect: true,
            singleSelect: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'taskId',
                    title: '任务ID'
                },
                {
                    field: 'taskName',
                    title: '任务名称',
                },
                {
                    field: 'startTime',
                    title: '开始时间',
                },
                {
                    field: 'endTime',
                    title: '结束时间',
                },
                {
                    field: 'description',
                    title: '描述',
                },
                {
                    field: 'executePlan',
                    title: '执行计划'
                }]
        };
        $.table.init(options);
    }

</script>
</body>
</html>